home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 015 / lptchk01.arc / LPTCHK.DOC < prev    next >
Encoding:
Text File  |  1987-04-14  |  2.4 KB  |  104 lines

  1. LPTCHK  Ver. 1.0   4/87    Public Domain    R.VanderKinter  Madison WI
  2.  
  3.         used as follows:
  4.  
  5.         LPTCHK n
  6.  
  7.   where n is the lpt port # to check.
  8.  
  9.   Returns ERRORLEVEL as follows:
  10.  
  11.                 4 OR HIGHER -GENERAL ERROR
  12.                 3 -CABLE NOT CONNECTED
  13.                 2 -PAPER OUT
  14.                 1 -PRINTER OFF LINE
  15.                 0 -PRINTER IS READY
  16.  
  17.  
  18.  
  19.  
  20. LPTCHK  when run, will set the ERRORLEVEL, and print a message indicating
  21.         what the ERRORLEVEL will be set to (unless redirected, e.g. > nul).
  22.  
  23.  
  24. LPTCHK<return>
  25.           displays instructions for use.
  26.  
  27.  
  28. LPTCHK <return>
  29.           at least one space causes LPTCHK to default to and check LPT1:,
  30.           set the errorlevel, and display what the errorlevel is set to.
  31.  
  32.  
  33. LPTCHK 1<return>
  34.           LPTCHK will check LPT1:, set the errorlevel,
  35.           and display what the errorlevel is set to.
  36.  
  37.  
  38. LPTCHK 2<return>
  39.           LPTCHK will check LPT2:, set the errorlevel,
  40.           and display what the errorlevel is set to.
  41.  
  42.  
  43. LPTCHK 123<return>
  44.           LPTCHK will check LPT1:, set the errorlevel,
  45.           and display what the errorlevel is set to.
  46.  
  47.  
  48. LPTCHK 1 > nul<return>
  49.           LPTCHK will check LPT1:, set the errorlevel,
  50.           but will not display what the errorlevel is set to.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. This is an EXAMPLE.BAT file using LPTCHK to check the printer status.
  59.  
  60.  
  61. ECHO OFF
  62. LPTCHK %1 > NUL
  63. IF ERRORLEVEL == 4  GOTO E4
  64. IF ERRORLEVEL == 3  GOTO E3
  65. IF ERRORLEVEL == 2  GOTO E2
  66. IF ERRORLEVEL == 1  GOTO E1
  67. IF ERRORLEVEL == 0  ECHO ..... PRINTER IS READY
  68. GOTO END
  69. :E4
  70. ECHO ..... GENERAL ERROR
  71. GOTO END
  72. :E3
  73. ECHO ..... CABLE NOT CONNECTED
  74. GOTO END
  75. :E2
  76. ECHO ..... OUT OF PAPER
  77. GOTO END
  78. :E1
  79. ECHO ..... PRINTER OFF LINE
  80. :END
  81.  
  82.  
  83.      This is a shorter version of EXAMPLE.BAT:
  84.  
  85. ECHO OFF
  86. LPTCHK %1 > NUL
  87. IF ERRORLEVEL == 1  GOTO E1
  88. IF ERRORLEVEL == 0  ECHO ..... PRINTER IS READY
  89. GOTO END
  90. :E1
  91. ECHO ..... PRINTER ERROR
  92. :END
  93.  
  94.  
  95. To use either of these, type:
  96.  
  97. EXAMPLE n<return>
  98.  
  99.       n = the printer port you wish to check.
  100. ════════════════════════════════════════════════════════════════════════════════
  101. Comments about LPTCHK may be left in messages for: Marty Shannon
  102.                                                    Cooperworks BBS
  103.                                                    (608)251-7734
  104.